package com.mrd.gtimp.base.entity;

import org.hibernate.annotations.Generated;
import org.hibernate.annotations.GenerationTime;
import org.hibernate.annotations.GenericGenerator;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Transient;

/**
 * <p> application name: gtimp <p> copyright: Copyright@2012 明睿达科技有限公司
 */

/**
 * 基础数据类
 *
 * @author qiul
 */
@Entity(name = "T_SYS_BASE")
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
public class SystemValue implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    @Id
    // 主键命名
    @GeneratedValue(generator = "shipId")
    // 自定义主键递增方式
    @GenericGenerator(name = "shipId", strategy = "com.mrd.gtimp.base.Identifier.SysValueIdGenerator")
    @Column(name = "id")
    private String id;
    /**
     * 父对象
     */
    @Column(name = "pid")
    @JoinColumn(name = "pid")
    private String parentId;
    /**
     * 中文名
     */
    @Column(name = "B_CHN_NAME")
    private String chn;
    /**
     * 英文名
     */
    @Column(name = "B_EN_NAME")
    private String en;
    /**
     * 标识符
     */
    @Column(name = "B_IDENTIFIER")
    private String identifier;
    /**
     * 备注
     */
    @Column(name = "B_MARK")
    private String mark;
    /**
     * 使用状态
     */
    @Column(name = "B_STATE")
    private String use_state;
    /**
     * 上次修改人
     */
    @Column(name = "B_UPDATE_USER")
    private String updateUser;
    /**
     * 上次修改时间
     */
    @Column(name = "B_UPDATE_DATE", insertable = false, updatable = false)
    @Generated(GenerationTime.ALWAYS)
    private String updateDate;
    /**
     * 删除状态 0表示未删除，1表示删除
     */
    @Column(name = "del_state")
    private String state;
    /**
     * 是否有子对象，用于辅助ztree，减少查询
     */
    @Transient
    private String havechild;

    /**
     * 是否为父对象，ztree辅助字段,true为是，false为不是
     */
    @Transient
    private String isParent;

    @Transient
    private List<SystemValue> children;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getHavechild() {
        return havechild;
    }

    public void setHavechild(String havechild) {
        this.havechild = havechild;
    }

    public String getIsParent() {
        return isParent;
    }

    public void setIsParent(String isParent) {
        this.isParent = isParent;
    }

    public String getChn() {
        return chn;
    }

    public void setChn(String chn) {
        this.chn = chn;
    }

    public String getEn() {
        return en;
    }

    public void setEn(String en) {
        this.en = en;
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }

    public String getMark() {
        return mark;
    }

    public void setMark(String mark) {
        this.mark = mark;
    }

    public String getUse_state() {
        return use_state;
    }

    public void setUse_state(String use_state) {
        this.use_state = use_state;
    }

    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    public String getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(String updateDate) {
        this.updateDate = updateDate;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public List<SystemValue> getChildren() {
        return children;
    }

    public void setChildren(List<SystemValue> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return "SystemValue [id=" + id + ", parenetId=" + parentId + ", chn=" + chn + ", en=" + en
                + ", identifier=" + identifier + ", mark=" + mark + ", use_state=" + use_state
                + ", updateUser=" + updateUser + ", updateDate=" + updateDate + ", state=" + state
                + ", havechild=" + havechild + ", isParent=" + isParent + "]";
    }

}
